package com.eqxiu.ieditor.api.controller.mall;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.eqxiu.ieditor.api.mall.IMallHotWordServiceApi;
import com.eqxiu.ieditor.commons.web.ResultData;
import com.eqxiu.ieditor.dto.mall.HotWordInputDTO;

import io.swagger.annotations.ApiOperation;

/**
* @description 商城-热词Controller
* @author  
* @modified DuYoulong 重构
* @creatTime 2019年4月3日  
* @since 1.0.0
*/
@RestController
public class HotwordController {
	
	/*@Autowired
	private MallService mallService;*/
	
	/*@GetMapping("/api/hotword/{type}")
	@ApiOperation(value = "通过商城定义热词,根据类型获取热词列表", responseContainer = "list")
	public ResultData getHotWord(@PathVariable Integer type) {
		return success().setList(mallService.getMallHotWord(type));
	}*/
	
	@Autowired
	private IMallHotWordServiceApi mallHotWordServiceApi;
	
	@GetMapping("/api/hotword/{type}")
	@ApiOperation(value = "根据类型获取热词列表", responseContainer = "list")
	public ResultData getHotWord(@PathVariable Integer type) {
		HotWordInputDTO dto = new HotWordInputDTO();
		dto.setType(type);
		return this.mallHotWordServiceApi.getHotWordList(dto );
	}

}
